__author__ = 'Robin'
from datiandouweb.models import Postion,Language
from django.core.cache import cache
from django.http import request
from datiandou import  settings

import logging
log = logging.getLogger(__name__)


def local_message(request):
    log.info(settings.STATICFILES_DIRS)
    log.info(request.META.get('HTTP_ACCEPT_LANGUAGE'))
    if not cache.get('dict'):
        all_Language = Language.objects.all()
        cache.set('dict',all_Language,24*60*60)
        log.info(cache.get('dict'))
    else:
        all_Language=cache.get('dict')
    global_var=dict({})
    global_var.setdefault('all_Language', all_Language)
    return global_var